//导入express框架
const express = require('express');
//创建express实例
const app = express();
//导入body-parser
var bodyParser = require('body-parser')
const port = '3000';
//导入cors
const cors = require('cors')
//parser application/x-www-form-urlencoded
//extended值false:值可以是字符串或数组。true:值可以是任意类型
app.use(bodyParser.urlencoded({extended:false}))
//parser application/json
app.use(bodyParser.json())
//全局挂载
app.use(cors())
//绑定和监听指定的主机和端口
app.listen(port, () => {
	console.log('listenPort:', port)
})